<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .content {
            width: 0;
            overflow: hidden;
            animation: changeRule 2.5s steps(10) infinite ;
            white-space: nowrap;
        }
        @keyframes changeRule {
            form {
                width: 0;
            }
            to {
                width: 160px;
            }
        }
    </style>
</head>
<body>
    <div class="content">这是一个打字机效果</div>
</body>
</html>